[IA64] Fix domain reboot bug
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 30 Mar 2006 19:41:48 +0000 (12:41 -0700)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 30 Mar 2006 19:41:48 +0000 (12:41 -0700)
Actually domain reboot issue is not caused by our previous patch
to solve schedule_tail, which instead helps to find a severe HOST_SMP
plus domain destroy bug.

The major reason is that currently VHPT table for dom0/domU is per LP,
while domain destroy only issues vhpt_flush on current LP (dom0 is running).
So VHPT table is not flushed on the LP that destroyed domU is running.

The mechanism of domain reboot is to kill current domain and create a new
domain with same configuration. Since region id recycle is added last time
with domain destroy support, the new created domain will inherit same
region id as previous one. Under this case, the stale entries in
VHPT table will make new domU halt.

Before applying our schedule_tail patch, domU will keep same pta
value as idle domain when first created where vhpt walker is disabled.
Because we use bvt as default scheduler, context switch never happens
as long as domU is runnable. That means domU will have vhpt DISABLED
in whole life cycle. So even vhpt on that LP is not flushed, domU
still runs correctly.

So we need to send IPI to target LP to flush right vhpt table. Especially,
based on our previous patch for schedule_tail, domU can get performance
gain by enabling vhpt walker.

Signed-off-by: Zhang xiantao <xiantao.zhang@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/ia64/linux-xen/smp.c
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/vhpt.c
xen/include/asm-ia64/vhpt.h

index fb84bb5b82658a4b21e3de5f36b305969d4114d8..953b930644311f3e3a8e48eaaa32f9ca78fd3a88 100644 (file)
@@ -47,6 +47,7 @@
 #include <asm/tlbflush.h>
 #include <asm/unistd.h>
 #include <asm/mca.h>
+#include <asm/vhpt.h>
 #ifdef XEN
 #include <asm/hw_irq.h>
 #endif
@@ -290,6 +291,11 @@ smp_flush_tlb_all (void)
 {
        on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
 }
+void
+smp_vhpt_flush_all(void)
+{
+    on_each_cpu((void (*)(void *))vhpt_flush, NULL, 1, 1);
+}
 
 #ifndef XEN
 void
index fd2a5692e883a2ee66582bbf2229f3dd1c3cc4f4..c4926421f3a966d4c2b8a8f7554190440af343b6 100644 (file)
@@ -106,7 +106,7 @@ void arch_domain_destroy(struct domain *d)
        flush_tlb_all();
 
        /* It is really good in this? */
-       vhpt_flush();
+       vhpt_flush_all();
 }
 
 static void default_idle(void)
index c6cadae6a9805b71a9267c87f06560e24e6bb21f..b6ef0a04d93f60a09272d308d2e75f8eda5ff797 100644 (file)
@@ -20,7 +20,7 @@ DEFINE_PER_CPU (unsigned long, vhpt_pend);
 
 void vhpt_flush(void)
 {
-       struct vhpt_lf_entry *v = (void *)VHPT_ADDR;
+       struct vhpt_lf_entry *v =__va(__ia64_per_cpu_var(vhpt_paddr));
        int i;
 #if 0
 static int firsttime = 2;
index 465065b351bf124a02a1dcb86244dcb5a5c931e0..d0a31c49fa2a5f116ddb8f1602daf0e4a791d5e8 100644 (file)
 
 #define        VHPT_PAGE_SHIFT                 VHPT_SIZE_LOG2
 
+
+#ifdef CONFIG_SMP
+# define vhpt_flush_all()      smp_vhpt_flush_all()
+#else
+# define vhpt_flush_all()   vhpt_flush()
+#endif
 // FIXME: These should be automatically generated
 
 #define        VLE_PGFLAGS_OFFSET              0